using Holoville.HOTween;
using Holoville.HOTween.Core;
using UnityEngine;

public class KillStreakImageFromScroll : MonoBehaviour
{
	public UIDragScrollView dragScrollView;

	public UISprite spriteKillEvent;

	public UILabel nameKill;

	public UILabel factorKill;

	public string nameSprite;

	public int factor;

	private void Awake()
	{
		nameKill.alpha = 0f;
		factorKill.alpha = 0f;
		spriteKillEvent.alpha = 0f;
	}

	private void Start()
	{
		HOTween.Init();
		factorKill.gameObject.SetActive(false);
	}

	public void AnimationSprite()
	{
		Debug.Log("AnimationSprite 1");
		spriteKillEvent.alpha = 1f;
		nameKill.alpha = 0f;
		factorKill.alpha = 0f;
		HOTween.To(spriteKillEvent.transform, 0.2f, new TweenParms().Prop("localScale", Vector3.one).OnComplete((TweenDelegate.TweenCallback)delegate
		{
			Debug.Log("AnimationSprite 2");
			if (factor > 1)
			{
				factorKill.gameObject.SetActive(true);
				factorKill.alpha = 1f;
				factorKill.text = "X" + factor;
			}
			else
			{
				factorKill.alpha = 0f;
			}
			nameKill.transform.localScale = Vector3.one * 1.2f;
			HOTween.To(nameKill, 0.2f, new TweenParms().Prop("alpha", 1));
			HOTween.To(nameKill.transform, 0.3f, new TweenParms().Prop("localScale", Vector3.one));
			factorKill.transform.localScale = Vector3.one * 1.2f;
			HOTween.To(factorKill, 0.2f, new TweenParms().Prop("alpha", 1));
			HOTween.To(factorKill.transform, 0.3f, new TweenParms().Prop("localScale", Vector3.one));
		}));
	}

	public void SetPicture()
	{
		spriteKillEvent.spriteName = nameSprite;
		spriteKillEvent.transform.localScale = Vector3.one * 2f;
		spriteKillEvent.alpha = 0f;
	}
}
